package com.example.gulimall.search.controller;

import com.example.common.to.es.SkuEsModel;
import com.example.common.utils.R;
import com.example.gulimall.search.service.ProductSaveService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.io.IOException;
import java.util.List;

/**
 * <p>
 *
 * </p>
 *
 * @author zyred
 * @since v 0.1
 **/
@RestController
@RequestMapping("/es/save")
public class ElasticsearchSaveController {

    @Autowired private ProductSaveService productSaveService;

    @PostMapping("/product")
    public boolean productStatusUp (@RequestBody List<SkuEsModel> skuEsModels) throws IOException {
        return this.productSaveService.productStatusUp(skuEsModels);
    }

}
